#pragma once
#include "Gui.h"
#include "Control/Container.h"

/********************************************************************
	Module    :
	Filename  : 	e:\Application\GuiDll\GuiSrc\wnd.h
	Author    :		Leon
	Version   :		1.01
	Date      :		15:10:2008   14:29
	Function  :	    
    Remark    :

    Modify history:
======================================================================
    Date      :
    Modifier  :
    Item      :
======================================================================

*********************************************************************/

enum AnimateType
{
	AniNone,
	AniMskVMiddle2Side,		//1
	AniVMiddle2Side,		//2	
	AniMskHMiddle2Side,		//3
	AniHMiddle2Side,		//4
	AniSlide2Left,			//5
	AniSlide2Right,			//6
	AniSlide2Top,			//7
	AniSlide2Bottom,		//8
	AniSlideSurf2Left,		//9
	AniSlideSurf2Right,		//10
	AniSlideSurf2Top,		//11
	AniSlideSurf2Bottom,	//12
	AniSlideScreen2Left,	//13
	AniSlideScreen2Right,	//14
	AniSlideScreen2Top,		//15
	AniSlideScreen2Bottom,	//16
	AniSliderSurMH2Side,    //17
	AniSliderSurSide2MH,    //18
	AniSliderSurMV2Side,    //19
	AniSliderSurSide2MV,    //20
	AniZoomOut,				//21
	AniZoomAlphaShow,		//22
};

enum MsgType
{
	MsgNone,
	MsgError,
	MsgCalibrate,
	MsgFacotoryRestore,
	MsgSDCardRemoved,
	MsgSDCardInserted,
	MsgInfo,
	MsgQuestionDeleteFile,
	MsgQuestionAddBookMark,
	MsgQuestionDelBookMark,
	MsgQuesitonSaveTime
};

class GUI_API CWnd
{
public:
	CWnd();
	virtual ~CWnd();

public:
	virtual BOOL ShowWindow(BOOL bShow);
	virtual BOOL Create(HINSTANCE hInst,HWND hWndParent,wstring strWndClass,wstring strWndName,BOOL bMsgThrdInside = FALSE);
	virtual BOOL OnCreate();
	void AnimateShow(CContainer* pCT,AnimateType aniType,int nAniSpeed,HBITMAP hBitmap,BOOL bMsgBox = FALSE,BOOL bExitAni = FALSE);

protected:
    virtual LRESULT WndProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
    virtual BOOL RegisterWnd(HINSTANCE hInst, const TCHAR *pcszWndClass);
    virtual void OnDestroy(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
    static LRESULT StaticWndProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);

public:
	HWND m_hWnd;

protected:
	HINSTANCE		m_hInst;
	HWND			m_hWndParent;
	wstring			m_strWndClass;
	wstring			m_strWndName;
	CRect			m_rcClient;

private:
	static DWORD CreateProc(PVOID pArg);
	BOOL	CreateWnd(void);
	BOOL	m_bCreated;
	BOOL	m_bMsgThrdInside;
	HANDLE  m_hEventCreated;
};
